use crate::models as m;
use crate::{impl_model_convert, impl_schema_convert};
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct Operate {
    pub id: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Create {
    pub name: String,
    pub description: String,
    pub base_dir: String,
}
impl_model_convert!(Create => m::project::ActiveModel { name, description, base_dir });

#[derive(Debug, Serialize, Deserialize)]
pub struct Update {
    pub id: String,
    pub name: String,
    pub description: String,
    pub base_dir: String,
}
impl_model_convert!(Update => m::project::ActiveModel { id, name, description, base_dir });

#[derive(Debug, Serialize, Deserialize)]
pub struct ListItem {
    pub id: String,
    pub name: String,
    pub description: String,
    pub base_dir: String,
    pub random: Option<i32>,
}
impl_schema_convert!(m::project::Model => ListItem { id, name, description, base_dir, random });
